package org.arch_learn.spring_cloud.scn_homework.service_user.feign.client;

import org.arch_learn.spring_cloud.scn_homework.service_user.feign.fallback.CodeFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import javax.validation.constraints.NotBlank;

@FeignClient(name = "service-code", path = "/code", fallback = CodeFeignClientFallback.class)
public interface CodeFeignClient {
    @GetMapping(value = "/validate/{email}/{code}")
    public ResponseEntity<Integer> validateCode(@PathVariable String email,
                                                @PathVariable @NotBlank String code);
}
